﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminMasterPage.master" EnableEventValidation="false"
    AutoEventWireup="true" CodeFile="images.aspx.cs" Inherits="Admin_Images" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="style/swfUploader.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="swfupload/swfupload.js"></script>
	<script type="text/javascript" src="swfupload/handlers.js"></script>
<script type="text/javascript">
    var swfu;
		window.onload = function () {
			swfu = new SWFUpload({
				// Backend Settings
			upload_url: "upload.aspx",
                post_params : {
                "gID": "<%=Request.QueryString[0] %>"
                },

				// File Upload Settings
				file_size_limit : "12 MB",
				file_types : "*.jpg",
				file_types_description : "JPG Images",
				file_upload_limit : "0",    // Zero means unlimited

				// Event Handler Settings - these functions as defined in Handlers.js
				//  The handlers are not part of SWFUpload but are part of my website and control how
				//  my website reacts to the SWFUpload events.
				file_queue_error_handler : fileQueueError,
				file_dialog_complete_handler : fileDialogComplete,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : uploadSuccess,
				upload_complete_handler : uploadComplete,

				// Button settings
				button_image_url : "images/XPButtonNoText_160x22.png",
				button_placeholder_id : "spanButtonPlaceholder",
				button_width: 160,
				button_height: 22,
				button_text : '<span class="button">Select Images <span class="buttonSmall">(2 MB Max)</span></span>',
				button_text_style : '.button { font-family: Helvetica, Arial, sans-serif; font-size: 14pt; } .buttonSmall { font-size: 10pt; }',
				button_text_top_padding: 1,
				button_text_left_padding: 5,

				// Flash Settings
				flash_url : "swfupload/swfupload.swf",	// Relative to this file

				custom_settings : {
					upload_target : "divFileProgressContainer"
				},

				// Debug Settings
				debug: false
			});
		}
	</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:Label runat="server" ID="lblTitle" Font-Bold="true" ForeColor="#006C52" ></asp:Label><br />
    <br />
    <asp:Label runat="server" ID="lbl1" Text="Добавить файлы"></asp:Label><br />
   
            <%--<CuteWebUI:Uploader runat="server" ID="Uploader1" InsertText="Upload Multiple Files (Max 10M)"
                MultipleFilesUpload="true" OnFileUploaded="Uploader_FileUploaded">
                <ValidateOption MaxSizeKB="10240" />
            </CuteWebUI:Uploader>--%>
             <div id="swfu_container" style="margin: 0px 10px;">
		    <div>
				<span id="spanButtonPlaceholder"></span>
		    </div>
		    <div id="divFileProgressContainer" style="height: 75px;"></div>
		    <div id="thumbnails"></div>
	    </div>
            
            <asp:DataList ID="dlGallery" runat="server" RepeatColumns="6" RepeatDirection="Horizontal"
                CellSpacing="10">
                <ItemTemplate>
                    <img id="imgGallery" src='<%=String.Format("../Thumbnails/SquareThumbnail.ashx?img={0}/Gallery/",FUNC.FullAppPath)%><%# Eval("ImagePath") %>&size=100' />
                    
                    <asp:ImageButton runat="server" ID="imgDelete" CommandArgument='<%# Eval("ID")%>'
                AlternateText="Delete" ToolTip="Удалить фаил" ImageUrl="~/Admin/images/delete.png" OnClick="imgDelete_Click" />    
                <br />
                </ItemTemplate>
                 <SeparatorTemplate>
                        <span> 
                        <table width="30px">
                            <tr>
                                <td style="width:30px;height:50px">
                                </td>
                            </tr>
                        </table>
                        </span> 
                    </SeparatorTemplate>
            </asp:DataList>
</asp:Content>
